/**
 * @Author：ming
 * @Date：2023/10/2 8:49 PM
 * @Filename：Hj6
 */

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @author ming
 */
public class Hj6 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str;
        while ((str=br.readLine())!=null){
            int n=  Integer.valueOf(str);
            List<Integer> list = getAll(n);
            Collections.sort(list);
            for (int i = 0; i < list.size(); i++) {
                System.out.print(list.get(i));
                if(i<list.size()-1){
                    System.out.print(" ");
                }

            }
        }
    }

    public static List<Integer> getAll(int n){
        List<Integer> list = new ArrayList<>();

        while (!isZhi(n)){
            for (int i = 2; i <=Math.sqrt(n) ; i++) {
                if(n%i==0){
                    list.add(i);
                    n = n/i;
                    break;
                }
            }

        }
        list.add(n);
        return list;
    }

    public static boolean isZhi(int n){

        if(n==2||n==3){
            return true;
        }

        for (int i = 2; i <=Math.sqrt(n) ; i++) {
            if(n%i==0){
                return false;
            }
        }
        return true;
    }
}
